-
-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement BOM export tool #8756
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8756 +/- ##
==========================================
+ Coverage 85.23% 85.55% +0.31%
==========================================
Files 1177 1177
Lines 51804 51549 -255
Branches 2094 2094
==========================================
- Hits 44156 44101 -55
+ Misses 7119 6919 -200
Partials 529 529
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@SchrodingersGat this will require an API version bump as it removes a number of endpoints; maybe it makes more sense to include these in #8686 |
@matmair good point, I will roll the BOM exporter into this one. I just have to devise a clean way to have a "custom" exporter within our new framework |
@matmair @wolflu05 I have an idea here which requires some further fleshing out - feedback welcomed :) Current SituationThe new "data export" framework basically takes our existing DRF serializers, and pushes the data into a formatted file for download. It is very efficient, low code overhead, and integrates seamlessly with the PUI data tables. The intent here is that the table data (as presented and filtered) is basically "what you get" when you download the data via the table interface. Legacy BOM ExporterThe legacy BOM exporter contained a lot of extra information. Supplier parts, alternative part options, pricing data, stock information, etc. That's all fine, but it doesn't fit nicely within the concept of a simple "press this button to download the table data" approach. Custom ReportI see the "BOM exporter" (as it existed in CUI) working better as a custom report generator. There are custom operations in the background which do not take place in the regular "export serialized data" framework. So, what I would like to propose is that we extend the "report generation" framework to allow arbitrary file generation. While currently it is limited to templated PDF files, there's no reason we can't have a "BOM export" plugin which generates an excel or .csv file for download. However this would require a lot of ripping up / refactoring of existing code. Also, how do we handle custom reports that do not make use of the report "template"? Before I go and start making changes, I'd love some feedback from you guys on how you think it should work - or potentially other ideas / approaches. |
I think the cleanest way would be to add a custom serializer that handles the BOM export and its options. We could add the option to use plugins to add serializers for custom exports. |
Thanks for the feedback, that sounds pretty reasonable |
Ref: #8685 (comment)
Followup to #8685